package com.example.application1;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.graphics.Rect;
import android.os.Bundle;
import android.view.View;

public class LearningActivity extends AppCompatActivity {

    private RecyclerView rv_list1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_learning);
        rv_list1 = findViewById(R.id.rv_list1);
        rv_list1.setLayoutManager(new LinearLayoutManager(LearningActivity.this));
        rv_list1.addItemDecoration(new myDecoration());
        rv_list1.setAdapter(new UnitAdapter(LearningActivity.this));

    }

    class myDecoration extends RecyclerView.ItemDecoration {
        @Override
        public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
            super.getItemOffsets(outRect, view, parent, state);
            outRect.set(0, 0, 0, 3);
        }
    }
}